<?php error_reporting(E_ALL && ~ E_NOTICE);
session_start();


include '../../db/dbConnect.php';
include '../function/mysql.php';
?>
<style type="text/css">
.question{
    width: 95%;
    color: #009F00;
    font-size: 16px;
    font-weight: bold;
    border-radius: 3px 3px 0px 0px;
    padding: 10px 10px 5px 10px;
    background: none repeat scroll 0% 0% #D1F38F;
    margin: 5px auto;
}
.answer{
    font-weight: 100;
    font-size: 14px;
    color: #000;
    background: none repeat scroll 0% 0% #FFF;
    width: 94%;
    border-radius: 0px 0px 3px 3px;
    margin: 5px 0px;
    padding: 0px 3%;
    line-height: 1.7;
}
</style>
<?php
if($_SERVER['REQUEST_METHOD']=="GET" && ($_GET["user_profile"] || $_GET["id"]  )){
    $user=($_GET["user_profile"]!=0)?$_GET["user_profile"]:$_GET["id"] ;
    $host=0;if($user==$_SESSION['LoginData']['iduser'])$host=1;
}else {
    //unset($user);
    $host=1;
    $user=$_SESSION['LoginData']['iduser'];
}
?>
<div class="w100p hQ">
    <h3 class="w40p left">Giới thiệu về bản thân</h3>
</div>
<div id="q_about" mode="<?php echo $user?>">

<?php 

	$result=select_quest_user($user,1,0,0);
	while($row=mysql_fetch_array($result)){
?>
<div class="question"><?php echo $row['ques'];?>
    <?php if($host==1){?>
        <a href="#" idq="<?php echo $row['ques'];?>" class="btn-icon ansNew">Sửa</a>
    <?php }?>

    <div class="answer"><?php echo $row['ans'];?></div>
</div>
<?php }
$sql='select * from u_profile_question as q
		where  q.idpr_question NOT IN(
								select ab.idpr_question
								from u_answer_about as ab
								where ab.iduser="'.$user.'")
			and kind=1 order by q.idpr_question asc';
			$re=mysql_query($sql);
			echo mysql_error();
			while($row=mysql_fetch_array($re)){
?>
<div class="question"><?php echo $row['question'];?>
    <?php if($host==1){?>
        <a href="#" class="btn-icon ansNew">Trả lời</a>
    <?php }?>

    <div class="answer"></div>
</div>
<?php }
?>
</div><!--end q_about-->

<div id="detail"><div class="hQ w100p hQ1" style="">Nếu bạn quan tâm:</div>
<?php
$sql='select *
      from u_user
      where iduser="'.$user.'"';
$result_1=$result=mysql_query($sql);
echo mysql_error();
$row=mysql_fetch_array($result);
?>

<!--<dl> <dt>Last Online</dt> <dd> Online now! </dd> </dl>-->
<dl> <dt>Dân tộc</dt> <dd id="ajax_ethnicities"> <?php if($row['ethnicity']){ echo $row['ethnicity'];} else echo '-'; ?> </dd> </dl>
<dl> <dt>Chiều cao</dt> <dd id="ajax_bodytype"><?php if($row['height']){ echo $row['height'].' m';} else echo '-'; ?></dd> </dl>
<dl> <dt>Cân nặng</dt>  <dd id="ajax_height"><?php if($row['weight']){ echo $row['weight'].' Kg';} else echo '-'; ?></dd> </dl>
<dl> <dt>Ăn kiêng</dt> <dd id="ajax_diet"> <?php if($row['diet']){ echo $row['diet'];} else echo '-'; ?> </dd> </dl>
<dl> <dt>Hút thuốc</dt> <dd id="ajax_smoking"><?php if($row['smoke']){ echo $row['smoke'];} else echo '-'; ?></dd> </dl>
<dl> <dt>Uống rượu</dt> <dd id="ajax_drinking"><?php if($row['drink']){ echo $row['drink'];} else echo '-'; ?></dd> </dl>

<dl> <dt>Tôn giáo</dt> <dd id="ajax_religion">  <?php if($row['religion']){ echo $row['religion'];} else echo '-'; ?></dd> </dl>
<dl> <dt>Học vấn</dt> <dd id="ajax_education"><?php if($row['education']){ echo $row['education'];} else echo '-'; ?></dd> </dl>
<dl> <dt>Công việc</dt> <dd id="ajax_job"><?php if($row['job']){ echo $row['job'];} else echo '-'; ?></dd> </dl>

 <dl> <dt>Tình trang quan hệ</dt> <dd id="ajax_status"><?php if($row['rel_status']){ echo $row['rel_status'];} else echo '-'; ?></dd> </dl>
 <dl> <dt>Có con</dt> <dd id="ajax_children"><?php if($row['offspring']){ echo $row['offspring'];} else echo '-'; ?></dd> </dl>
<dl> <dt>Thú cưng</dt> <dd id="ajax_pets"> <?php if($row['pet']){ echo $row['pet'];} else echo '-'; ?> </dd> </dl>
<dl> <dt>Ngôn ngữ</dt> <dd id="ajax_languages"> <?php if($row['speak']){ echo $row['speak'];} else echo '-'; ?> </dd> </dl>
<div class="clear"></div>
</div>

